package com.weimei.conversionTreasure.viewModel;


import androidx.databinding.ObservableField;

import com.weimei.conversionTreasure.activity.VipActivity;
import com.weimei.conversionTreasure.activity.compute.BzjdActivity;
import com.weimei.conversionTreasure.activity.compute.CbActivity;
import com.weimei.conversionTreasure.activity.compute.GdjsActivity;
import com.weimei.conversionTreasure.activity.compute.JjjsActivity;
import com.weimei.conversionTreasure.activity.compute.JjmdActivity;
import com.weimei.conversionTreasure.activity.compute.SheRuActivity;
import com.weimei.conversionTreasure.activity.compute.TjZlActivity;
import com.weimei.conversionTreasure.activity.compute.TjdActivity;
import com.weimei.conversionTreasure.activity.compute.UpDownActivity;
import com.weimei.conversionTreasure.http.entity.TabOneEntity;
import com.weimei.conversionTreasure.utils.UserUtils;

import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;
import me.goldze.mvvmhabit.utils.ToastUtils;

public class TabOneItemVM extends ItemViewModel {
    public ObservableField<TabOneEntity> entity = new ObservableField<>();


    TabOneVM mTabOneVM;
    public TabOneItemVM(TabOneVM tabOneVM, TabOneEntity tabOneEntity) {
        super(tabOneVM);
        entity.set(tabOneEntity);
        mTabOneVM = tabOneVM;
    }

    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            switch (entity.get().tabStr){
                case "降度/升度":
                    mTabOneVM.startActivity(UpDownActivity.class);
                    break;
                case "体积/重量":
                    mTabOneVM.startActivity(TjZlActivity.class);
                    break;
                case "勾调计算":
                    mTabOneVM.startActivity(GdjsActivity.class);
                    break;
                case "成本计算":
                    mTabOneVM.startActivity(CbActivity.class);
                    break;
                case "标准酒度":
                    mTabOneVM.startActivity(BzjdActivity.class);
                    break;
                case "酒精密度":
                    mTabOneVM.startActivity(JjmdActivity.class);
                    break;
                case "20℃酒度":
                    mTabOneVM.startActivity(TjdActivity.class);
                    break;
                case "摄入计算":
                    mTabOneVM.startActivity(SheRuActivity.class);
                    break;
                case "加浆计算":
                    mTabOneVM.startActivity(JjjsActivity.class);
                    break;
                case "更多":
                    ToastUtils.showShort("正在研发中...");
                    break;

            }
        }
    });


}
